package DataStructure.BinaryTreePra;

/**
 * @time: 2021/12/14/014 10:40
 * @author: Zhurunhe
 * @Version：1
 */
public class BinaryTreeTest {
    public static void main(String[] args) {
        BinaryTree binaryTree=new BinaryTree();
        Node no1=new Node(1,"一号队员");
        Node no2=new Node(2,"二号队员");
        Node no3=new Node(3,"三号队员");
        Node no4=new Node(4,"四号队员");
        Node no5=new Node(5,"五号队员");

        no1.setLeft(no2);
        no1.setRight(no3);
        no3.setRight(no4);
        no3.setLeft(no5);
        binaryTree.setNode(no1);
        //二叉树 前中后序遍历
//        binaryTree.printPreorderTraversal();//12354
//        binaryTree.printInorderTraversal();//21534
//        binaryTree.printPostorderTraversal();//25431

        //二叉树 前中后序遍历查找
//        binaryTree.preorderTraversalSearch(5);
//        binaryTree.inorderTraversalSearch(5);
//        binaryTree.postorderTraversalSearch(5);

        //二叉树 前中后序进行删除
        binaryTree.removeNode(3);
    }
}
